<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<head>

<script>
	var medicinePrescriptions = [];
	
</script>

<c:forEach items="${medicinePrescriptions}" var="medicinePrescription">
	<script type="text/javascript">
		var medicinePrescription = {
			'timeSegment':"${medicinePrescription.timeSegment}",
			'departmentName':"${medicinePrescription.departmentName}",
			'doctorName':"${medicinePrescription.doctorName}",
			'seq':"${medicinePrescription.seq}",
			'addTime':"${medicinePrescription.addTime}",
			'chargeTime':"${medicinePrescription.chargeTime}",
			'medicineTime':"${medicinePrescription.medicineTime}",
			'name': "${medicinePrescription.name}",
			'medicineNum': "${medicinePrescription.medicineNum}",
			'price':"${medicinePrescription.price}",
		};
		debugger;
		medicinePrescriptions.push(medicinePrescription);
	</script>
</c:forEach>

<script type="text/javascript">
	
	$(function() {
		dataGrid = $('#dataGrid').datagrid({
			striped : true,
			rownumbers : true,
			singleSelect : true,
			idField : 'id',
			sortName : 'id',
			sortOrder : 'asc',
			columns :[[{
				width : '150',
				title : '时间段',
				field : 'timeSegment'
			},{
				width : '30',
				title : '排序号',
				field : 'seq'
			},{
				width : '80',
				title : '挂号科室',
				field : 'departmentName'
			},{
				width : '80',
				title : '就诊医生',
				field : 'doctorName'
			},{
				width : '150',
				title : '开单时间',
				field : 'addTime'
			},{
				width : '150',
				title : '缴费时间',
				field : 'chargeTime',
			},{
				width : '150',
				title : '取药时间',
				field : 'chargeTime'
			}, {
				width : '80',
				title : '药品名称',
				field : 'name'
			}, {
				width : '80',
				title : '药品数量',
				field : 'name'
			},{
				width : '80',
				title : '药品价格',
				field : 'price'
			}] ],
			data: medicinePrescriptions
		});
	});

</script>
</head>

<div class="easyui-layout" data-options="fit:true,border:false">
	
	<div data-options="region:'center',fit:true,border:false">
		<table id="dataGrid" data-options="fit:true,border:false"></table>
	</div>
</div>
